<%@ page import="com.the8thfold.anton.users.Roles; com.the8thfold.anton.ant.JobStatus; org.apache.tools.ant.Target" contentType="text/html;charset=UTF-8" %>
<html>
<head>
    <title>Create User</title>
    <meta name="layout" content="main" />
</head>
<body>

<div>
    <h1>Create User</h1>
    <hr/>
    <br/>
    <div>
        <g:form controller="account" action="save" name="newUserForm">
            <table style="border: none; width: auto;">
                <tr>
                    <td>User Name:</td>
                    <td>
                        <input type="text" id="userName" name="userName" />
                    </td>
                    <td>Email:</td>
                    <td>
                        <input type="text" id="emailAddress" name="emailAddress" />
                    </td>
                </tr>

                <tr>
                    <td>First Name:</td>
                    <td>
                        <input type="text" id="firstName" name="firstName" />
                    </td>
                    <td>Last Name:</td>
                    <td>
                        <input type="text" id="lastName" name="lastName" />
                    </td>
                </tr>

                <tr>
                    <td>Password:</td>
                    <td>
                        <input type="password" id="password" name="password"/>
                    </td>
                    <td>Confirm Password:</td>
                    <td>
                        <input type="password" id="password2" name="password2"/>
                    </td>
                </tr>

                <tr>
                    <td >Roles:</td>
                    <td colspan="1">
                        <input type="checkbox" name="c1" id="${Roles.ROLE_ADMIN}" value="${Roles.ROLE_ADMIN}" /> <label for="${Roles.ROLE_ADMIN}">Admin</label>
                    </td>
                    <td colspan="1">
                        <input type="checkbox" name="c1" id="${Roles.ROLE_SCRIPT_ADMIN}" value="${Roles.ROLE_SCRIPT_ADMIN}" /> <label for="${Roles.ROLE_SCRIPT_ADMIN}">Manage Scripts</label>
                    </td>
                </tr>
                <tr>
                    <td ></td>
                    <td colspan="1">
                        <input type="checkbox" name="c1" id="${Roles.ROLE_JOB_ADMIN}" value="${Roles.ROLE_JOB_ADMIN}" /> <label for="${Roles.ROLE_JOB_ADMIN}">Manage Jobs</label>
                    </td>
                    <td colspan="1">
                        <input type="checkbox" checked="" name="c1" id="${Roles.ROLE_JOB_RUN}" value="${Roles.ROLE_JOB_RUN}" /> <label for="${Roles.ROLE_JOB_RUN}">Run Jobs</label>
                    </td>
                </tr>
                <tr>
                    <td ></td>
                    <td colspan="1">
                        <input type="checkbox" name="c1" id="${Roles.ROLE_RESULTS_ADMIN}" value="${Roles.ROLE_RESULTS_ADMIN}" /> <label for="${Roles.ROLE_RESULTS_ADMIN}">Manage Results</label>
                    </td>
                    <td colspan="1">
                        <input type="checkbox" checked="" name="c1" id="${Roles.ROLE_RESULTS_VIEW}" value="${Roles.ROLE_RESULTS_VIEW}" /> <label for="${Roles.ROLE_RESULTS_VIEW}">View Results</label>
                    </td>
                </tr>

                <tr>
                    <td colspan="4"><hr/></td>
                </tr>
                <tr>
                    <td colspan="4">
                        <sec:ifAllGranted roles="${Roles.ROLE_SCRIPT_ADMIN}">
                            <div class="css_right toolbar">
                                <input type="button" class="btn-text" name="cancel" onclick="history.go(-1);" value="Cancel"/>
                                <g:submitButton name="submit" value="Create" />
                            </div>
                        </sec:ifAllGranted>
                    </td>
                </tr>
            </table>
        </g:form>
    </div>
</div>

</body>
</html>